<?php
class actType extends logCAr
{
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}
	
	/* reset db */
	public function getDbConnection()
	{
		self::$db=Yii::app()->db1;
		if(self::$db instanceof CDbConnection) return self::$db;
	}
	
    public function tableName()
	{
		return '{{act_type}}';
	}
    /* rules */
    public function rules()
    {
        return array(
            array('name', 'safe', 'on'=>'search'),
        );
    }
    public function search()
    {
        $criteria=new CDbCriteria;
        $criteria->order='create_time desc';
        $criteria->compare('del_flag',0);
        if ($this->name)$criteria->compare('name',$this->name);
        return new CActiveDataProvider($this, array(
            'criteria'=>$criteria,
        ));
    }

    static function types(){

        return [
            "1"=>"游乐场所",
            "2"=>"玩具门店",
            "3"=>"潮玩门店",

            "4"=>"展会/展览",
            "5"=>"其他",
        ];

    }

}